﻿<?php
@session_start();
include_once('utils/Resources.php');
require("lib/core/Session.php");
require("lib/core/Object.php");
require_once('utils/CommonUtils.php');
$onlineUser = Session::get('fullname');

$commonUtils = new CommonUtils();
if($onlineUser == null)
	$commonUtils->redirect("login.php"); 
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Website Quản Lý Nhà Thuốc Theo Chuẩn GPP</title>
    <link href="css/PMStyle.css" rel="stylesheet" type="text/css" />
    <link href="css/menu.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/navigation.js" language="javascript"></script>
	<script language="javascript" type="text/javascript"></script>
	<script type="text/javascript" src="resources/re_common.js"/></script>
	
	<link rel="stylesheet" type="text/css" href="extjs/plugin/ux/fileuploadfield/css/fileuploadfield.css"/>
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"/>
    <link rel="stylesheet" type="text/css" href="css/extjs.css" />
</head>
<body>
	<div id="north"><?php include 'include/header.php'?></div>
    <div id="tabs" style="margin:0px 0; vertical-align: top; height: 500px;">
    <form style="display:none;" id="exportForm" target="_blank" name="form" method="POST" enctype="multipart/form-data">
		</form>
    </div>
    <div id="south"><?php include 'include/footer.php'?></div>
</body>
<!-- LIBS -->
    <script type="text/javascript" src="extjs/adapter/ext/ext-base-debug.js"></script>
    <script type="text/javascript" src="extjs/ext-all-debug.js"/></script>
    <script type="text/javascript" src="js/prototype.js"/></script>
    <script type="text/javascript" src="js/FormUtils.js"/></script>
    <!-- ENDLIBS -->
    
	<!-- Plugins -->
	<script type="text/javascript" src="extjs/plugin/ux/TabCloseMenu.js"/></script>
	<script type="text/javascript" src="extjs/plugin/ux/RowEditor.js"/></script>
	<script type="text/javascript" src="extjs/plugin/ux/FileUploadField.js"/></script>
	<!-- Common -->
	<script type="text/javascript" src="js/common.js"/></script>
<!-- End LIBS -->
<form style="display:none;" id="exportForm" target="_blank" name="form" method="POST" enctype="multipart/form-data">';
<input name="flagPDF"></input>
<input name="strSearch"></input>
<input name="strSearchForExport"></input></form>
<script type="text/javascript">
Ext.PagingToolbar.override({ paramNames : {start: 'pg4_offset', limit: 'maxPageItems'} });
Ext.onReady(function(){
	Ext.QuickTips.init();
	Ext.form.Field.prototype.msgTarget = "side";
    Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    var viewport = new Ext.Viewport({
        layout: 'border',
        items: [{
	            region: 'north',
	            contentEl : 'north',
	            split: false,
	            collapsible: false,
	            margins: '-1 -1 0 -1'
        	},{
        		region: 'south',
                contentEl: 'south',
                split: false,
                collapsible: false,
                margins: '0 0 0 0'
        	},new Ext.TabPanel({
                region: 'center', 
                id: 'maintabs-id',
                deferredRender: false,
                activeTab: 0,     
		        resizeTabs:true, 
		        minTabWidth: 115,
		        tabWidth:160,
		        enableTabScroll:true,
		        defaults: {autoScroll:true},
		        margins: '0 0 0 0',
		        plugins: new Ext.ux.TabCloseMenu()
            })
        ]
    });		
});
	<?php if(isset($loadFirst) && $loadFirst != null){ ?>
		Ext.getCmp('maintabs-id').add(<?php echo $loadFirst["targetid"]?>('<?php echo $loadFirst["targetid"]?>', 'application/controller/<?php echo $loadFirst["url"]?>', {crudaction : 'search', pg4_offset : 0, maxPageItems : 10} , '<?php echo $loadFirst["name"]?>', '<?php echo $loadFirst["role"]?>')).show();
	<?php }?>
</script>
<script type="text/javascript" src="application/view/help.js" ></script>
</html>
 